home *** CD-ROM | disk | FTP | other *** search
- // CSemaphorePicture.cp
-
- #include "CSemaphorePicture.h"
- #include <ctype.h>
-
-
- CSemaphorePicture::CSemaphorePicture(
- LStream* inStream): LPicture(inStream)
- {
-
- }
-
- CSemaphorePicture::~CSemaphorePicture()
- {
- // do nothing
- }
-
- // ---------------------------------------------------------------------------------
- // • HandleKeyPress
- // ---------------------------------------------------------------------------------
- // Interpret key commands
-
- Boolean
- CSemaphorePicture::HandleKeyPress( const EventRecord& inKeyEvent)
- {
- int theKey = (unsigned char) inKeyEvent.message & charCodeMask;
- int thePicture = 0;
-
- if (theKey==' ') {
- thePicture = 0;
- } else if (('A' <= theKey) && (theKey <= 'Z')) {
- thePicture = (theKey - int('A') + 1);
- } else if (('a' <= theKey) && (theKey <= 'z')) {
- thePicture = (theKey - int('a') + 101);
- }
- SetPictureID(thePicture);
- Refresh();
- return true;
- }
-